package com.mylogger;

public enum MyLogLevel{
	OFF(0,"off"),
	ERROR(1,"error"),
	INFO(2,"info"),
	DEBUG(3,"debug");

	private int priority;
	private String levelString;
	
	MyLogLevel(int priority,String str){
		this.priority = priority;
		this.levelString = str;
	}
	
	public boolean isLowerOrEqual(MyLogLevel level) {
        return ( this.priority >= level.getPriority() );
    }
	
	public boolean isGreaterOrEqual(MyLogLevel level) {
        return ( this.priority <= level.getPriority() );
    }

	public int getPriority() {
		return priority;
	}
	
	@Override
	public String toString() {
		return levelString;
	}
	
}
